/* tslint:disable */
/* eslint-disable */
/**
 * Deepfence ThreatMapper
 * Deepfence Runtime API provides programmatic control over Deepfence microservice securing your container, kubernetes and cloud deployments. The API abstracts away underlying infrastructure details like cloud provider,  container distros, container orchestrator and type of deployment. This is one uniform API to manage and control security alerts, policies and response to alerts for microservices running anywhere i.e. managed pure greenfield container deployments or a mix of containers, VMs and serverless paradigms like AWS Fargate.
 *
 * The version of the OpenAPI document: v2.5.3
 * Contact: community@deepfence.io
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */

import { exists, mapValues } from '../runtime';
import type { ModelBasicNode } from './ModelBasicNode';
import {
    ModelBasicNodeFromJSON,
    ModelBasicNodeFromJSONTyped,
    ModelBasicNodeToJSON,
} from './ModelBasicNode';

/**
 * 
 * @export
 * @interface ModelVulnerability
 */
export interface ModelVulnerability {
    /**
     * 
     * @type {boolean}
     * @memberof ModelVulnerability
     */
    cisa_kev: boolean;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_attack_vector: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_caused_by_package: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_caused_by_package_path: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_container_layer: string;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerability
     */
    cve_cvss_score: number;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_description: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_fixed_in: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_link: string;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerability
     */
    cve_overall_score: number;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_severity: ModelVulnerabilityCveSeverityEnum;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    cve_type: string;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerability
     */
    epss_score: number;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    exploit_poc: string;
    /**
     * 
     * @type {boolean}
     * @memberof ModelVulnerability
     */
    has_live_connection: boolean;
    /**
     * 
     * @type {boolean}
     * @memberof ModelVulnerability
     */
    masked: boolean;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    namespace: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    node_id: string;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    parsed_attack_vector: string;
    /**
     * 
     * @type {Array<ModelBasicNode>}
     * @memberof ModelVulnerability
     */
    resources?: Array<ModelBasicNode> | null;
    /**
     * 
     * @type {string}
     * @memberof ModelVulnerability
     */
    rule_id: string;
    /**
     * 
     * @type {number}
     * @memberof ModelVulnerability
     */
    updated_at: number;
    /**
     * 
     * @type {Array<any>}
     * @memberof ModelVulnerability
     */
    urls: Array<any> | null;
}


/**
 * @export
 */
export const ModelVulnerabilityCveSeverityEnum = {
    Critical: 'critical',
    High: 'high',
    Medium: 'medium',
    Low: 'low',
    Unknown: 'unknown'
} as const;
export type ModelVulnerabilityCveSeverityEnum = typeof ModelVulnerabilityCveSeverityEnum[keyof typeof ModelVulnerabilityCveSeverityEnum];


/**
 * Check if a given object implements the ModelVulnerability interface.
 */
export function instanceOfModelVulnerability(value: object): boolean {
    let isInstance = true;
    isInstance = isInstance && "cisa_kev" in value;
    isInstance = isInstance && "cve_attack_vector" in value;
    isInstance = isInstance && "cve_caused_by_package" in value;
    isInstance = isInstance && "cve_caused_by_package_path" in value;
    isInstance = isInstance && "cve_container_layer" in value;
    isInstance = isInstance && "cve_cvss_score" in value;
    isInstance = isInstance && "cve_description" in value;
    isInstance = isInstance && "cve_fixed_in" in value;
    isInstance = isInstance && "cve_id" in value;
    isInstance = isInstance && "cve_link" in value;
    isInstance = isInstance && "cve_overall_score" in value;
    isInstance = isInstance && "cve_severity" in value;
    isInstance = isInstance && "cve_type" in value;
    isInstance = isInstance && "epss_score" in value;
    isInstance = isInstance && "exploit_poc" in value;
    isInstance = isInstance && "has_live_connection" in value;
    isInstance = isInstance && "masked" in value;
    isInstance = isInstance && "namespace" in value;
    isInstance = isInstance && "node_id" in value;
    isInstance = isInstance && "parsed_attack_vector" in value;
    isInstance = isInstance && "rule_id" in value;
    isInstance = isInstance && "updated_at" in value;
    isInstance = isInstance && "urls" in value;

    return isInstance;
}

export function ModelVulnerabilityFromJSON(json: any): ModelVulnerability {
    return ModelVulnerabilityFromJSONTyped(json, false);
}

export function ModelVulnerabilityFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelVulnerability {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'cisa_kev': json['cisa_kev'],
        'cve_attack_vector': json['cve_attack_vector'],
        'cve_caused_by_package': json['cve_caused_by_package'],
        'cve_caused_by_package_path': json['cve_caused_by_package_path'],
        'cve_container_layer': json['cve_container_layer'],
        'cve_cvss_score': json['cve_cvss_score'],
        'cve_description': json['cve_description'],
        'cve_fixed_in': json['cve_fixed_in'],
        'cve_id': json['cve_id'],
        'cve_link': json['cve_link'],
        'cve_overall_score': json['cve_overall_score'],
        'cve_severity': json['cve_severity'],
        'cve_type': json['cve_type'],
        'epss_score': json['epss_score'],
        'exploit_poc': json['exploit_poc'],
        'has_live_connection': json['has_live_connection'],
        'masked': json['masked'],
        'namespace': json['namespace'],
        'node_id': json['node_id'],
        'parsed_attack_vector': json['parsed_attack_vector'],
        'resources': !exists(json, 'resources') ? undefined : (json['resources'] === null ? null : (json['resources'] as Array<any>).map(ModelBasicNodeFromJSON)),
        'rule_id': json['rule_id'],
        'updated_at': json['updated_at'],
        'urls': json['urls'],
    };
}

export function ModelVulnerabilityToJSON(value?: ModelVulnerability | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'cisa_kev': value.cisa_kev,
        'cve_attack_vector': value.cve_attack_vector,
        'cve_caused_by_package': value.cve_caused_by_package,
        'cve_caused_by_package_path': value.cve_caused_by_package_path,
        'cve_container_layer': value.cve_container_layer,
        'cve_cvss_score': value.cve_cvss_score,
        'cve_description': value.cve_description,
        'cve_fixed_in': value.cve_fixed_in,
        'cve_id': value.cve_id,
        'cve_link': value.cve_link,
        'cve_overall_score': value.cve_overall_score,
        'cve_severity': value.cve_severity,
        'cve_type': value.cve_type,
        'epss_score': value.epss_score,
        'exploit_poc': value.exploit_poc,
        'has_live_connection': value.has_live_connection,
        'masked': value.masked,
        'namespace': value.namespace,
        'node_id': value.node_id,
        'parsed_attack_vector': value.parsed_attack_vector,
        'resources': value.resources === undefined ? undefined : (value.resources === null ? null : (value.resources as Array<any>).map(ModelBasicNodeToJSON)),
        'rule_id': value.rule_id,
        'updated_at': value.updated_at,
        'urls': value.urls,
    };
}

